using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Xml;



namespace ClientGUI
{
    /// <summary>
    /// Testing Display Form
    /// </summary>
	public partial class UseDisplay : Form
	{
        /// <summary>
        /// Testing display form
        /// </summary>
		public UseDisplay()
		{
			InitializeComponent();
			XmlDocument config = new XmlDocument();
			config.LoadXml(global::ClientGUI.Config.Configuration_xml); 
            DocEdit.Config = new Configuration(config);
		}

		private void button1_Click(object sender, EventArgs e)
		{
			if (xmlbox.Text.Length < 10) {
				return;
			}
			XmlDocument doc = new XmlDocument();
            try
            {
                doc.LoadXml(xmlbox.Text);
            }
            catch (XmlException e1)
            {
                MessageBox.Show(e1.Message);
                return;
            }
			DocEdit.SetDocument(doc);
		}

        private void unrender_btn_Click(object sender, EventArgs e)
        {
            XmlDocument doc = DocEdit.GetDocument();
            
            xmlbox.Text = doc.OuterXml;
        }
	}
}